import { defineStore } from "pinia";
import { reactive } from "vue";

const useUserStore = defineStore(
  "user",
  () => {
    const userinfo = reactive({});

    const setUser = (newUser) => {
        userinfo.value = newUser;
    };
    const getUser = () => {
      return userinfo;
    };

    return {
      userinfo,
      setUser,
      getUser,
    };
  },
  {
    persist: true,
  }
);

export default useUserStore
